package com.encryption.controls.tip
{
	import com.encryption.controls.util.MouseDownOutHandleUtil;
	
	import flash.display.DisplayObject;
	import flash.geom.Point;
	
	import mx.controls.ToolTip;
	
	/**
	 * 继承自ToolTip，当鼠标点击其它地方时该提示需要消失。
	 * @author jill
	 * @version 1.0
	 * @created 14-五月-2012 13:29:31
	 */
	public class UserOperationTip extends ToolTip
	{
		function UserOperationTip(){
			downOutSideHandle();
		}
		
		/**
		 * 更新该控件显示的位置
		 */
		public function updateLocation(displayObject:DisplayObject): void
		{
			var globalPoint:Point = displayObject.localToGlobal(new Point(0, 0));
			this.x = globalPoint.x  + displayObject.width;
			this.y = globalPoint.y;
		}
		
		private function downOutSideHandle():void
		{
			MouseDownOutHandleUtil.addListener(this);
		}
		
		
	}//end OperationTip
}